package com.tourscool.springboot.starter.seata;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import io.seata.core.context.RootContext;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FeignInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate){
        String xid = RootContext.getXID();
        requestTemplate.header(RootContext.KEY_XID,xid);
    }
}
